<?php

/* 
    修改
 */
require 'dbcon.php';
$id=$_GET['id'];
$name=$_REQUEST['name'];//获取名字
$imgurl=$_REQUEST['imgurl'];//获取头像
$department=$_REQUEST['department'];//获取部门
$birthday=$_REQUEST['birthday'];//获取生日
$entry=$_REQUEST['entry'];//获取入职时间
$sql="update tb_staff set name='{$name}',imgurl='{$imgurl}',department='{$department}',birthday='{$birthday}',entry='{$entry}' where id={$id}";

$rs=$db->query($sql);//执行查询语句$sql，生成结果集$result
$db->close();//关闭数据库连接
if ($rs==true)
{
    echo "<script>";    
    echo "location.href='index.php'";
    echo "</script>";
}
else   
{
    echo "<script>";  
    echo "alert('修改失败！');";
    echo "location.href='index.php'";
    echo "</script>";
}

